#include "utils.hpp"

std::pair<std::vector<float>, std::vector<float>> createData()
{
    std::vector<float> inputs, labels;
    float x, y, r, dis = 0.1;
    //
    srand(static_cast<unsigned int>(time(0)));
    //
    std::ofstream file_out("data.txt");
    for (int i = 0; i <= 100; i++)
    {
        x = ( double )i * dis + 10.0;
        r = ( double )rand() / ( double )RAND_MAX - 0.5;
        y = x + 1.0 + 2.0 * r;
        inputs.push_back(x);
        labels.push_back(y);
        file_out << x << " " << y << std::endl;
    }
    file_out.close();
    // 文 件 输 出
    return std::make_pair(inputs, labels);
}
